]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Adjust CSS for RTL locales
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 19 Feb 2011 11:21:07 +0000 (12:21 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 21 Feb 2011 16:38:47 +0000 (17:38 +0100)
The groups at the panel sides use different left/right padding, so
a slightly different CSS is required for RTL locales. Add :rtl
pseudo classes as necessary and adjust the CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=642697

data/theme/gnome-shell.css
js/ui/panel.js

index 08f636f509def3035245067a617848ff46478f44..0bd1566b62d78856a59be3b28f628f15c6bfe0d8 100644 (file)
@@ -196,10 +196,20 @@ StTooltip StLabel {
     padding-right: 4px;
 }
 
+#panelLeft:rtl {
+    padding-right: 0px;
+    padding-left: 4px;
+}
+
 #panelRight {
     padding-left: 4px;
 }
 
+#panelRight:rtl {
+    padding-left: 0px;
+    padding-right: 4px;
+}
+
 #appMenu {
     spacing: 4px;
 }
index 2b315993d51536f66697c37bab47c7973e25f3e8..41bb04486d1cac69a3934a47c12235b6f52f08eb 100644 (file)
@@ -528,6 +528,13 @@ Panel.prototype = {
         this._centerBox = new St.BoxLayout({ name: 'panelCenter' });
         this._rightBox = new St.BoxLayout({ name: 'panelRight' });
 
+        // This will eventually be automatic, see
+        // https://bugzilla.gnome.org/show_bug.cgi?id=584662
+        if (St.Widget.get_default_direction() == St.TextDirection.RTL) {
+            this._leftBox.add_style_pseudo_class('rtl');
+            this._rightBox.add_style_pseudo_class('rtl');
+        }
+
         /* This box container ensures that the centerBox is positioned in the *absolute*
          * center, but can be pushed aside if necessary. */
         this._boxContainer = new Shell.GenericContainer();